﻿@model IEnumerable<FollowPeers.Models.PatentModel>
@{
    ViewBag.Title = "Patent Db";
}
@Html.Partial("_Header")

<div class="container" id="main">
    <div class="row">
    @Html.Partial("_SideBar1")
    <div class="span7">
        <h3> Your Patents</h3>
        @Script("jquery.validate.min.js")
        @Script("jquery.validate.unobtrusive.min.js")
        @Script("jquery.bgiframe.js")
        @Script("jquery.mcdropdown.js")
        @Script("jquery-1.7.1.min.js")
        @Script("jquery.dataTables.min")
        @Script("index.js")
        <link rel="stylesheet" type="text/css" href="../../Content/css/jquery.mcdropdown.css" />
        <link href="../../Content/css/jquery-ui.css" rel="stylesheet" type="text/css" />
        <link href="../../Content/css/table.css" rel="stylesheet" type="text/css" />
        <br />
        @{
            if (Model.Count() == 0)
            {
                 <a class="btn btn-primary" href="../../PatentModel/Create/1">Add Patent</a>
            <br/>
                 <legend>You haven't added patents to your profile</legend>
            <br />
            }
            else
            {
                <a class="btn btn-primary" href="../../PatentModel/Create/1">Add Patent</a>
            <br/>
            <table id="myDataTable" class="table table-hover">
                <thead>
                    <tr>
                        <th>
                            Title
                        </th>
                        <th>
                            Patent Number
                        </th>
                        <th>
                            Country
                        </th>
                        <th>
                            Approval Year
                        </th>
                        <th>
                            Actions
                        </th>
                    </tr>
                </thead>
                <tbody>
                    @foreach (var item in Model)
                    {
                        <tr>
                            <td>
                                @Html.DisplayFor(modelItem => item.Title)
                            </td>
                            <td>
                                @Html.DisplayFor(modelItem => item.RefNo)
                            </td>
                            <td>
                                @Html.DisplayFor(modelItem => item.Country)
                            </td>
                            <td>
                                @Html.DisplayFor(modelItem => item.AproveYear)
                            </td>
                            <td>
                                @Html.ActionLink("More..", "Details", new { id = item.ID })
                            </td>
                        </tr>
                    }
                </tbody>
            </table>
            } 
        }
        </div>
    </div>
</div>
@Html.Partial("_Footer")
@helper Script(string scriptName)
    {
    <script src="@Url.Content("~/Scripts/" + scriptName)" type="text/javascript"></script>
}
